// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
import less from 'less';

import '@assets/styles/reset.css';
import '@assets/styles/index.less';
import Cookies from 'js-cookie';
// import './assets/styles/border.css';
import '@assets/styles/zhanhui/iconfont/iconfont.css';
// import 'swiper/swiper.min.css';
import '@assets/styles/varibless.less';
import store from '@store/index.js';
// import echarts from "echarts";
import Moment from 'moment';
import ExportFile from 'vue-json-excel';
import XLSX from 'xlsx';
import { layoutUrl, imgUrl, macUrl, pictureUrl, mqttUrl } from '@/api/URLConfig';

Vue.component('ExportFile', ExportFile);
// import './unit/rem'
import {
  Form,
  FormModel,
  Input,
  Select,
  Button,
  DatePicker,
  Radio,
  message,
  Layout,
  Menu,
  Breadcrumb,
  Table,
  Switch,
  Checkbox,
  Row,
  Col,
  Icon,
  Popconfirm,
  Upload,
  Modal,
  Tabs,
  Tag,
  Rate,
  Steps,
  Descriptions,
  Result,
  List,
  Avatar,
  InputNumber,
  Spin,
  ConfigProvider,
  Pagination,
  Progress,
  Drawer,
  Card,
  Calendar,
  Tooltip,
  TimePicker,
  Collapse,
  Empty,
  TreeSelect,
  Dropdown,
  Notification,
  Divider,
  Popover
} from 'ant-design-vue';

// import 'ant-design-vue/dist/antd.css';
import { codemirror } from 'vue-codemirror';
import 'codemirror/lib/codemirror.css';

// 这里也可以直接执行 toastRegistry()
// Vue.use(toastRegistry, VueScroller, vuex, vuescroll, less);
Vue.use(Form);
Vue.use(FormModel);
Vue.use(Input);
Vue.use(Button);
Vue.use(Select);
Vue.use(DatePicker);
Vue.use(Radio);
Vue.use(Switch);
Vue.use(Checkbox);
Vue.use(Col);
Vue.use(Row);
Vue.use(Layout);
Vue.use(Menu);
Vue.use(Breadcrumb);
Vue.use(Icon);
Vue.use(Table);
Vue.use(Popconfirm);
Vue.use(Upload);
Vue.use(Modal);
Vue.use(Tabs);
Vue.use(Tag);
Vue.use(Rate);
Vue.use(Result);
Vue.use(Steps);
Vue.use(Descriptions);
Vue.use(List);
Vue.use(Avatar);
Vue.use(InputNumber);
Vue.use(Spin);
Vue.use(ConfigProvider);
Vue.use(Pagination);
Vue.use(Progress);
Vue.use(Drawer);
Vue.use(Card);
Vue.use(Calendar);
Vue.use(Tooltip);
Vue.use(TimePicker);
Vue.use(Collapse);
Vue.use(Empty);
Vue.use(TreeSelect);
Vue.use(less);
Vue.use(codemirror);
Vue.use(Dropdown);
Vue.use(Notification);
Vue.use(Divider);
Vue.use(Popover);
Vue.use(XLSX);
Vue.prototype.$message = message;
// Vue.prototype.$echarts = echarts;
Vue.prototype.$Modal = Modal;
Vue.prototype.$Moment = Moment;
Vue.prototype.$Cookies = Cookies;

Vue.prototype.$layoutUrl = layoutUrl;
Vue.prototype.$imgUrl = imgUrl;
Vue.prototype.$macUrl = macUrl;
Vue.prototype.$pictureUrl = pictureUrl;
Vue.prototype.$mqttUrl = mqttUrl;

message.config({
  duration: 3, // 持续时间
  top: `150px`, // 到页面顶部距离
  maxCount: 3, // 最大显示数, 超过限制时，最早的消息会被自动关闭
});
Vue.config.productionTip = false;

const vueInstance = new Vue({
  el: '#app',
  router,
  scrollBechavior() {
    return { x: 0, y: 0 };
  },
  store,
  components: { App },
  render: (h) => h(App),
}).$mount('#app');

export default vueInstance;
